<?php
$hostname = "localhost";
$username = "root";
$password = "root";
$dbname   = "yasi";
$conn = mysql_connect($hostname, $username, $password) or die ("Error: could not connect to database");
mysql_select_db($dbname);

$userid = addslashes($_POST['userid']);
$userinfo = array();
foreach($_POST as $key=>$value){
	if($key != 'userid'){
		$userinfo[$key] = $value;
	}
}

$result = mysql_query("select * from tb_whv_user where user_id='".$userid."'");
if($row = mysql_fetch_array($result)){
	echo $row['user_info'];
}else{
	echo '{"errorMsg":"No application form found."}';
}
mysql_close($conn);
?>
